<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 个人证器
 */
class people extends AdminBase
{

    // 验证规则
    protected $rule =   [
      'username'              => 'require|unique:people',
      'password'              => 'require',
      'email'                 => 'require|email|unique:people',
      'mobile'                => 'require|unique:people|number',
      'nickname'              => 'require',

    ];

    // 验证提示
    protected $message  =   [

      'username.require'              => '用户名不能为空',
      'username.unique'               => '用户名已存在',
      'password.require'              => '密码不能为空',
      'email.require'                 => '邮箱不能为空',
      'mobile.number'                 => '手机号必须为数字',
      'mobile.require'                => '手机号不能为空',
      'nickname.require'              => '昵称不能为空',
    ];

    // 应用场景
    protected $scene = [

        'edit' =>  ['username','email','mobile','nickname'],
        'add'  =>  ['username','email','mobile','nickname'],
    ];

}
